﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
using UnityEngine.Events;

namespace Assets.HSVPicker
{
	// Token: 0x02000032 RID: 50
	public class ColorPresetList
	{
		// Token: 0x06000107 RID: 263 RVA: 0x0000C684 File Offset: 0x0000A884
		public ColorPresetList(string listId, List<Color> colors = null)
		{
			if (colors == null)
			{
				colors = new List<Color>();
			}
			this.Colors = colors;
			this.ListId = listId;
		}

		// Token: 0x17000026 RID: 38
		// (get) Token: 0x06000108 RID: 264 RVA: 0x0000C6A7 File Offset: 0x0000A8A7
		// (set) Token: 0x06000109 RID: 265 RVA: 0x0000C6AF File Offset: 0x0000A8AF
		public string ListId { get; private set; }

		// Token: 0x17000027 RID: 39
		// (get) Token: 0x0600010A RID: 266 RVA: 0x0000C6B8 File Offset: 0x0000A8B8
		// (set) Token: 0x0600010B RID: 267 RVA: 0x0000C6C0 File Offset: 0x0000A8C0
		public List<Color> Colors { get; private set; }

		// Token: 0x14000001 RID: 1
		// (add) Token: 0x0600010C RID: 268 RVA: 0x0000C6CC File Offset: 0x0000A8CC
		// (remove) Token: 0x0600010D RID: 269 RVA: 0x0000C704 File Offset: 0x0000A904
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		public event UnityAction<List<Color>> OnColorsUpdated;

		// Token: 0x0600010E RID: 270 RVA: 0x0000C73A File Offset: 0x0000A93A
		public void AddColor(Color color)
		{
			this.Colors.Add(color);
			if (this.OnColorsUpdated != null)
			{
				this.OnColorsUpdated(this.Colors);
			}
		}

		// Token: 0x0600010F RID: 271 RVA: 0x0000C764 File Offset: 0x0000A964
		public void UpdateList(IEnumerable<Color> colors)
		{
			this.Colors.Clear();
			this.Colors.AddRange(colors);
			if (this.OnColorsUpdated != null)
			{
				this.OnColorsUpdated(this.Colors);
			}
		}
	}
}
